package com.lin.ai.config;

import redis.clients.jedis.JedisPooled;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedisConfig {

    @Bean
    public JedisPooled jedisPooled() {
        // 替换为你的 Redis 主机和端口
        String redisHost = "localhost";
        int redisPort = 6379;

        // 如果有密码认证，可以传入密码
//        String redisPassword = "yourpassword"; // 如果没有密码，可以省略

//        if (redisPassword == null || redisPassword.isEmpty()) {
            return new JedisPooled(redisHost, redisPort);
//        } else {
//            return new JedisPooled(redisHost, redisPort, redisPassword);
//        }
    }
}